Tutorial:
----------------------
Making new maps for BW
----------------------
-ADVANCED-

This tutorial teaches you how to make a fully custom terrain map with a new terrain and a background(s).
Use this tutorial if you want to learn to create a Scene with whole new terrain 
and new BGs for BW arena use.


Contents:

1. Terrain
2. Backgrounds
3. Scene File



Note: 
Map = Scene = Map
BW = Ballistic Weapons = this mod = BW.rte


==========
1. Terrain
==========

Terrain is the ground in your map and it is usually a large bmp file with a special terrain palette.
If there is already a terrain you want whether in the default CC's selection or 
BW's selection, then continue to the next section.

A good start is to go to BW.rte/Maps/Terrains folder where are some examples.
All these files have a material palette you can get by either saving the 
palette from the picture with photoshop/paint shop pro type of programs or by using
any existing terrain file and drawing over it and saving it as a new file.

Drawing terrain is easy and you can only use the colors you saw in the other terrains.
Paint whatever terrain you like and then save it in the BW.rte/Maps/Terrains folder.

-----
HINT: Run Length Encoding when saving the new mapfile can save you alot of disk space.
If youre doing the terrain over an existing one and saving it as a new file, then its already done.



Finally we need the terrain code. All terrains for BW are found in BW.rte/Maps/Terrains.ini
Open that with a notepad or similar and there you will see some examples of the terrains 
already in place. Copy paste one of these at the end of the same file and modify the paths
and names. The path will be BW.rte/Maps/Terrains since you saved the terrain there and the 
name can be anything you want. To make things easier to work with, use clear and simple names.
Ex: Your terrain file is named MyNewMap.bmp so you could make the name be MyNewMap Terrain for instance.

In the terrain code there are these things:


--CODE--
AddTerrain = SLTerrain
	PresetName = Andoryu Terrain   <-- Name of terrain (not name of your map though, thats a different thing)
	BitmapFile = ContentFile
		Path = BW.rte/Maps/Terrains/Andoryu.bmp   <-- Name of your terrain .bmp file you painted.
	WrapX = 1   <-- If 1, the map will loop in X aka horizontal direction so you can walk forever. If 0, there will be borders where the terrain file usually has.
	WrapY = 0   <-- Same as above, except vertical looping. Using this is glitchy will make your map very wierd. Use with caution. No maps in BW use it usually.
	ScrollRatio = Vector
		X = 1.0
		Y = -1.0
	BackgroundTexture = ContentFile
		Path = BW.rte/Maps/Textures/BWTexBG.bmp  <--This one is always the same, dont change it. Its the background terrain texture when a terrain is removed.
	AddTerrainFrosting = TerrainFrosting  <--The next part is completely optional. This first bit adds grass on top of the brown terrain. You can remove it if dont want grass.
		TargetMaterial = Material
			CopyOf = Bw Topsoil
		FrostingMaterial = Material
			CopyOf = BW Grass
		MinThickness = 5
		MaxThickness = 7
		InAirOnly = 1
	AddTerrainDebris = TerrainDebris  <-- These are randomly scattered terrain stuff. The first one is gold, the second one is plants and then stones. You can delete or leave any of these.
		CopyOf = Gold
	AddTerrainDebris = TerrainDebris
		CopyOf = Plants
	AddTerrainDebris = TerrainDebris  <--word of warning though, if youre making an underground map, these will pop in your caves you might have created.
		CopyOf = Boulders
--/CODE--


Then save the Terrains.ini file after you added your terrain entry. Done!



==============
2. Backgrounds
==============

So you want a custom backround or two for you map? If yes, continue reading or if not, 
continue to the next section. Backgrounds are easy to implement to a map, 
but you must make them right.

The background files dont usually have any mandatory size, but a good rule is to make 
them be larger than the lowest resolution you can play CC in. And thats 640x480 pixels.
I suggest making them 800x600 pixels since some player might be playing CC in a higher 
resolution and it might make the background look not big enough.

You can either find pictures on the internet or paint your own backgrounds.

In either case, you'll need to use the CC object palette for it. Object palette is practically 
used by everything except terrain. You can either paint on top of an existing CC sprite or 
save a palette from them and then apply to your background image if youre using 
photoshop/paint shop pro or any other program capable of doing that.

WARNING!: Do NOT use Run Length Encoding here when saving your new background file, 
it will fuck up the sprite ingame or make CC fail to load and freeze or just crash.

Save the background in BW.rte/Maps/BG folder.




After youve painted your beatiful background and made sure its in the CC object palette,
and saved it, you'll need to define it in the code. A good place to start for that is
BW.rte/Maps/BG.ini. This is where all the custom backgrounds are defined.

Copy paste the third piece of code (The one that has this name: PresetName = CM Back Layer) 
which is the background file code for the main background in Crater Mounds and paste it at 
the end of the file. Then lets look at it:


--CODE--
AddBackgroundLayer = SceneLayer
	PresetName = CM Back Layer   <-- The name of your background. Change this to whatever you like, but try to be clean and simple with the name.
	AddToGroup = Far Backdrops   <-- Group where the background belongs to. This one is the main background group.
	DrawTransparent = 0
	WrapX = 1
	WrapY = 0
	ScrollRatio = Vector   <-- To be honest, I have no fucking clue how these work, but they are used to control how fast/slow the background will scroll while you play. Keep them like this and then see if they need to be tweaked.
		X = 0.003
		Y = 2100
	BitmapFile = ContentFile
		Path = BW.rte/Maps/BG/CMBack.bmp   <--file name of your awesome terrain. Replace the CMBack.bmp with your [filename].bmp
--/CODE--


It is possible to have multiple layers of backgrounds too. Do the same like you did 
above and see for examples for other layers in the BW.rte/Maps/BG folder. 
Remember that the purple color is considered "invisible".
Except that "AddToGroup = Far Backdrops" should be changed to 
"AddToGroup = Mid Backdrops" or "AddToGroup = Near Backdrops" depending where they are positioned.
Like the clouds in CrateMounds are "Near" and the mountains are "Mid".




=============
3. Scene File
=============

Almost done, now we just have to create a Terrain Scene file for your new map 
and tie the terrain and the backgrounds to it.

Go to the BW.rte/Maps/Scenes folder and copy paste yourself a copy of BWTER_Temp.ini.
Rename the file to BWTER_[My map name].ini (Without the brackets.)
Keep this file in BW.rte/Maps/Scenes

And then open it up in notepad.


--CODE--
AddScene = Scene
	PresetName = BWTER_Template <-- This will be your map name. Keep the "BWTER_" prefix in the name. Change it to whatever you want your map to be called. Ex: BWTER_AwesomeMapLOL
	LocationOnPlanet = Vector
		X = 0
		Y = 0
	Terrain = SLTerrain
		CopyOf = BW.rte/MyCoolMap Terrain  <<-- Here is where you reference a terrain file. Either use one from the existing ones or use your own terrain all by copy-pasting the name of the terrain here. Remember its in the Terrains.ini

//Default Backgrounds:                      <<-- These below are the default backgrounds. To use you own, whether you only made one layer: Simply copy-paste the name of the background you did in BG.ini and delete the other 2 layers if you want. For more layers: Replace the names with your background names and add/remove any background entries if necesary. List them from the highest being the closest layer and the lowest being the farthest layer.
	AddBackgroundLayer = SceneLayer
		CopyOf = Base.rte/Near Layer B
	AddBackgroundLayer = SceneLayer
		CopyOf = Base.rte/Clouds Layer
	AddBackgroundLayer = SceneLayer
		CopyOf = Base.rte/Sky Layer

	GlobalAcceleration = Vector          <<-- Gravity. Y = 20 is default downwards gravity. This thing is fun to mess with.
		X = 0
		Y = 20
--/CODE--


After you've done with tweaking this file, save it.
To make it load ingame, you'll have to list it in the BW.rte/Maps/Index.ini file.
So lets open that up:


--CODE--
// Universal stuff

IncludeFile = BW.rte/Maps/BG.ini
IncludeFile = BW.rte/Maps/Materials.ini
IncludeFile = BW.rte/Maps/Objects.ini
IncludeFile = BW.rte/Maps/Terrains.ini
//Note: Textures can be only single type. Making a map with other new textures requires a new .rte. So fuck that.

// Blank Terrain Scenes

IncludeFile = BW.rte/Maps/Scenes/BWTER_Andoryu.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_Barracks.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_Bridge.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_BridgedPit.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_CraterMounds.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_DeathCave.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_Depths.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_SandBank.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_SandPass.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_TheDeep.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_ThePit.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_ThunderCave.ini

// Vanilla Terrain Scenes

IncludeFile = BW.rte/Maps/Scenes/Vanilla/Index.ini


--/CODE--


As you can see, the first part references the files we worked with earlier 
and the second part is where all the Terrain scenes are listed. Also the
"Vanilla Terrain Scenes" are copies of the default CC 
Terrain Scenes so they could be used in BW.
The third part are the official pre-built arena maps.

Now you can add you map at the end of the second list(or aplhabetically), 
but I've tried to keep the terrain maps in an aplhabetical order.
Its nothing too important, but it makes the whole thing look a tad more organized.

Anyways add a new line to the end or in the middle of the second list:

--CODE--
// Universal stuff

IncludeFile = BW.rte/Maps/BG.ini
IncludeFile = BW.rte/Maps/Materials.ini
IncludeFile = BW.rte/Maps/Objects.ini
IncludeFile = BW.rte/Maps/Terrains.ini
//Note: Textures can be only single type. Making a map with other new textures requires a new .rte. So fuck that.


// Blank Terrain Scenes

IncludeFile = BW.rte/Maps/Scenes/BWTER_Andoryu.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_Barracks.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_Bridge.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_BridgedPit.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_CraterMounds.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_DeathCave.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_Depths.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_LongLand.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_SandBank.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_SandPass.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_ShortZone.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_SuperLongLand.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_TheDeep.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_ThePit.ini
IncludeFile = BW.rte/Maps/Scenes/BWTER_ThunderCave.ini

// Vanilla Terrain Scenes

IncludeFile = BW.rte/Maps/Scenes/Vanilla/Index.ini
--/CODE--


Save it and youre done.
Congratulations! You have created a new Terrain scene with new terrain and 
(probably) new backgrounds. Next you might want to build the actual arena 
on it with all the bells and whistles.

For that, check the "Making New Maps for BW -BASIC-.txt".